Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#123): added-iconlayer-support #129

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

am2222
Copy link

@am2222 am2222 commented Jun 20, 2024

  • Added support for iconlayer
  • had to replace iconAtlas to iconAtlasConfig. For some reason iconAtlas param is overwritten in the parent class. I assume it is due to the property type of image and since it also accepts string and this causes the overwritten. I am not very familiar with deckgl's layer param validations if you can guide me to fix it I can finish this PR.

I assume a multipoint support can also be added here. maybe in the next PR.

Any additional comments are welcomed. Thanks!

Comment on lines +34 to +36
| "getRadius"
| "getFillColor"
| "getLineColor"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't exist on IconLayerProps

Comment on lines +58 to +77
/**
* Radius accessor.
* @default 1
*/
getRadius?: FloatAccessor;
/**
* Fill color accessor.
* @default [0, 0, 0, 255]
*/
getFillColor?: ColorAccessor;
/**
* Stroke color accessor.
* @default [0, 0, 0, 255]
*/
getLineColor?: ColorAccessor;
/**
* Stroke width accessor.
* @default 1
*/
getLineWidth?: FloatAccessor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't make sense for IconLayer

* If not provided, will be inferred by finding a column with extension type
* `"geoarrow.point"` or `"geoarrow.multipoint"`.
*/
getPosition?: ga.vector.PointVector | ga.vector.MultiPointVector;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, you should remove | ga.vector.MultiPointVector since this layer as written only supports points

Comment on lines +37 to +38
| "iconAtlas"
| "iconMapping"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to omit the properties that we redefine. It doesn't look like we redefine these, so you don't want to remove these from the type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said we do want to redefine any accessors. So we would usually want to add getIcon, getSize, getColor, getAngle, getPixelOffset. We need to check that deck works with a vectorized getIcon function though. No other layers have a string return type from a get* accessor

@kylebarron
Copy link
Member

I haven't had time to organize it yet, but in theory development here might be moving to a semi-official deck.gl fork in https://github.com/visgl/deck.gl-community

@am2222
Copy link
Author

am2222 commented Jun 24, 2024

@kylebarron thanks!
I have some more updates on this layer and would like to add them to this PR eventually!

But as part of moving to community layers repository! Is this something planned to happend per each geoarrow layer separately?

Or is the plan to transfer the entire set of the geoarrow layers there all at once?

@kylebarron
Copy link
Member

But as part of moving to community layers repository! Is this something planned to happend per each geoarrow layer separately?

Or is the plan to transfer the entire set of the geoarrow layers there all at once?

It was already forked in visgl/deck.gl-community#67 and the existing layers are all at https://github.com/visgl/deck.gl-community/tree/master/modules/arrow-layers. But I haven't had time to actually test using them in my code (in Lonboard), and no one else is working on this right now.

If you were interested, you could try out using the deck.gl-community version of arrow-layers in your project and check that it works the same.

@am2222
Copy link
Author

am2222 commented Jun 24, 2024

@kylebarron ok so I will check that version!
So shall I open a PR for Icon layers in that repository once I checked them?

@kylebarron
Copy link
Member

Yeah that sounds great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants